package com.fsm.system.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 *  表定义层。
 *
 * @author
 * @since
 */
public class TSystemMenuTable extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    public static final TSystemMenuTable T_SYSTEM_MENU = new TSystemMenuTable();

    /**
     * 菜单id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 父级id
     */
    public final QueryColumn PID = new QueryColumn(this, "pid");

    /**
     * 菜单标记
     */
    public final QueryColumn ICON = new QueryColumn(this, "icon");

    /**
     * 菜单名称
     */
    public final QueryColumn TITLE = new QueryColumn(this, "title");

    /**
     * 菜单路径
     */
    public final QueryColumn PATH = new QueryColumn(this, "path");

    /**
     * 是否存在
     */
    public final QueryColumn EXIST = new QueryColumn(this, "exist");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 修改时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, TITLE, PATH, ICON, PID, CREATE_TIME, UPDATE_TIME, EXIST};

    public TSystemMenuTable() {
        super("", "t_system_menu");
    }

    private TSystemMenuTable(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TSystemMenuTable as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TSystemMenuTable("", "t_system_menu", alias));
    }

}
